<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-money" data-rule="required" class="form-control" step="0.01" name="row[money]" type="number" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Limit')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-limit" data-rule="required" class="form-control" step="0.01" name="row[limit]" type="number" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Grant_nums')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-grant_nums" data-rule="required" class="form-control" name="row[grant_nums]" type="number" value="">
            <p class="text-gray" style="margin-top: 5px;">{:__('Reminder: Set to -1 to unlimited quantity')}</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Draw_limit')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-draw_limit" data-rule="required" class="form-control" name="row[draw_limit]" type="number" value="">
            <p class="text-gray" style="margin-top: 5px;">{:__('Reminder: If set to 0, there is no limit on the number of claims')}</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Validity_type')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                {foreach name="validityTypeList" item="vo"}
                <label for="row[validity_type]-{$key}"><input id="row[validity_type]-{$key}" name="row[validity_type]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label>
                {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group validity_days-content hidden">
        <label class="control-label col-xs-12 col-sm-2">{:__('Validity_days')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-validity_days" class="form-control" name="row[validity_days]" type="number" value="">
            <p class="text-gray" style="margin-top: 5px;">{:__('Note: If you set it to 0, it will not expire')}</p>
        </div>
    </div>
    <div class="validity_time-content">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-start_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:date('Y-m-d H:i:s')}">
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
            <div class="col-xs-12 col-sm-8">
                <input id="c-end_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{:date('Y-m-d H:i:s',time()+86400*7)}">
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="statusList" item="vo"}
            <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="normal"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Available_type')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                {foreach name="availableTypeList" item="vo"}
                <label for="row[available_type]-{$key}"><input id="row[available_type]-{$key}" name="row[available_type]" type="radio" value="{$key}" {in name="key" value="all"}checked{/in} /> {$vo}</label>
                {/foreach}
            </div>

        </div>
    </div>

    <div class="range_type-group hidden">
        <div class="form-group">
            <label class="control-label col-xs-12 col-sm-2">{:__('Range_type')}:</label>
            <div class="col-xs-12 col-sm-8">

                <div class="radio">
                    {foreach name="rangeTypeList" item="vo"}
                    <label for="row[range_type]-{$key}"><input id="row[range_type]-{$key}" name="row[range_type]" type="radio" value="{$key}" {in name="key" value="all"}checked{/in} /> {$vo}</label>
                    {/foreach}
                </div>

            </div>
        </div>

        <div class="form-group appoint_goods-group hidden">
            <label class="control-label col-xs-12 col-sm-2">{:__('Appoint goods')}:</label>
            <div class="col-xs-12 col-sm-8">
                <button type="button" class="btn btn-info btn-appoint_goods">{:__('Add goods')}</button>
                <table id="table_goods" class="table table-striped table-bordered table-hover table-nowrap" style="margin-top: 10px;">
                </table>
            </div>
        </div>

        <div class="form-group appoint_product-group hidden">
            <label class="control-label col-xs-12 col-sm-2">{:__('Appoint product')}:</label>
            <div class="col-xs-12 col-sm-8">
                <button type="button" class="btn btn-info btn-appoint_product">{:__('Add Product')}</button>
                <table id="table_product" class="table table-striped table-bordered table-hover table-nowrap" style="margin-top: 10px;">
                </table>
            </div>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>

<script>
    var rangGoods = [];

    var rangProduct = [];
</script>